//
//  SetTableViewCellO.m
//  EggSteward
//
//  Created by 王道林 on 16/9/7.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "SetTableViewCellO.h"
#import "Masonry.h"

@interface SetTableViewCellO ()
@property (nonatomic, strong) UIImageView *iamgeView;
@end
@implementation SetTableViewCellO

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView
{
    _labelTitle = [[BaseLabel alloc] init];
    [self.contentView addSubview:_labelTitle];
    
    _iamgeView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Unknown"]];
    [self.contentView addSubview:_iamgeView];
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    [_labelTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).mas_offset(15);
        make.top.mas_equalTo(self.contentView.mas_top).mas_offset(10);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).mas_offset(-10);
        make.width.mas_equalTo(self.contentView.mas_width).multipliedBy(0.5);
    }];
    
    [_iamgeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).mas_offset(-28);
        make.top.mas_equalTo(self.contentView.mas_top).mas_offset(21);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).mas_offset(-21);
        make.width.mas_equalTo(20);
    }];
    
}




@end
